package com.zhangji.practice.controller;

import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description： TODO
 * @Date： 2021/8/26 20:16
 * @Author： ZhangJi
 * @Version： 1.0
 */
@Controller
public class LoginController {

  @RequestMapping("/login")
  public String login(@RequestParam String username,@RequestParam String password, Model model){
    if(!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)){
      // 验证账号操作
      return "dashboard";
    }else {
      model.addAttribute("asdf","asdf");
      return "index";
    }
  }

}
